@BGroupTile @P@ICopyright Gold Disk Inc., February, 1992
This Genie will take the current group and make copies to fill an area.
*/
parse arg sx, sy, nrows, ncols, hsp, vsp
cr = '0a'x
address command
call SafeEndEdit.rexx()
call ppm_AutoUpdate(0)
units = ppm_GetUnits()
if units = 3 then
call ppm_SetUnits(1)
signal on halt
signal on break_c
signal on break_e
signal on break_d
defhsp = .5
defvsp = .5
if sx = '' then do
box = ppm_GroupFirstBox()
if box = 0 then exit_msg("Select a group of boxes first")
page = ppm_BoxPage(box)
if page = 0 then exit_msg("You must have a page created first")
marg = ppm_GetPageMargins(page)
pgsize = ppm_GetPageSize(page)
left = word(marg, 1)
top = word(marg, 2)
pwidth = word(pgsize, 1) - (left + word(marg, 3))
pheight = word(pgsize, 2) - (top + word(marg, 4))
grprect = ppm_GetGroupRect()
grpwid = word(grprect, 3) + defhsp
grphgt = word(grprect, 4) + defvsp
cols = pwidth % grpwid
rows = pheight % grphgt
if units = 3 then
do
form = "Start X:" || ppm_ConvertUnits(1, 3, left) ||cr"Start Y:" || ppm_ConvertUnits(1, 3, top) ||cr"Number of Columns:"cols||cr"Number of Rows:"rows||cr"Horizontal spacing:" || ppm_ConvertUnits(1, 3, defhsp) ||cr"Vertical spacing:"
form = form || ppm_ConvertUnits(1, 3, defvsp)
end
else
form = "Start X:"left||cr"Start Y:"top||cr"Number of Columns:"cols||cr"Number of Rows:"rows||cr"Horizontal spacing:"defhsp||cr"Vertical spacing:"defvsp
form = ppm_GetForm("Enter coordinates", 8, form)
if form = '' then exit_msg()
parse var form sx '0a'x sy '0a'x ncols '0a'x nrows '0a'x hsp '0a'x vsp
if units = 3 then
do
sx = ppm_ConvertUnits(3, 1, sx)
sy = ppm_ConvertUnits(3, 1, sy)
hsp = ppm_ConvertUnits(3, 1, hsp)
vsp = ppm_ConvertUnits(3, 1, vsp)
end
end
if ~(datatype(sy, n) & datatype(sx, n) & datatype(ncols, n) & datatype(nrows, n) & datatype(hsp, n) & datatype(vsp, n)) then
exit_msg("Invalid Entry")
call ppm_ShowStatus("Working..")
box = ppm_GroupFirstBox()
grprect = ppm_GetGroupRect()
grpleft = word(grprect, 1)
grptop = word(grprect, 2)
grpwid = word(grprect, 3) + hsp
grphgt = word(grprect, 4) + vsp
counter = 1
do while box ~= 0
boxpos = ppm_GetBoxPosition(box)
boxleft = word(boxpos, 1)
boxtop = word(boxpos, 2)
xoffset = boxleft - grpleft
yoffset = boxtop - grptop
call ppm_SetBoxPosition(box, sx + xoffset, sy + yoffset )